<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2024/12/24 0024
  Time: 14:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>生产派工单页面</title>
    <link rel="stylesheet" href="/bootstrap/bootstrap-5.3.3-dist/css/bootstrap.min.css" />
    <link rel="stylesheet" href="/css/manufactureCss/e/Production_Dispatch_Order.css" />
    <style type="text/css">

    </style>

</head>
<body style="background-color: #eeeeee;">
<div style="border: 2px solid #dcdcdc;height: 700px;border-radius: 10px;margin: 10px;">
    <div class="headBox">
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb">
                <span style="color: blue;">您正在做的业务是：</span>
                <li class="breadcrumb-item"><a href="#">生产管理</a></li>
                <li class="breadcrumb-item"><a href="#">生产调度管理</a></li>
                <li class="breadcrumb-item active" aria-current="page">制定生产派工单</li>
            </ol>
        </nav>
        <div>
            <div style="margin-bottom: 2px">
                <div style="display: inline;margin-left: 89%;">
                    <button class="btn btn-primary" id="preview">预览</button>
                    <button class="btn btn-primary">返回</button>
                </div>
            </div>
            <div id="bodyBox">
                <table id="tbl">
                    <tr>
                        <td class="col1">工单制定人</td>
                        <td class="col2"><input type="text" id="designer" value="${user.loginId}"/></td>
                        <td class="col1">出库单编号集合</td>
                        <td class="col2"><label></label></td>
                    </tr>
                    <tr>
                        <td class="col1">登记人</td>
                        <td class="col2"><input type="text" id="register" value="${user.loginId}"/></td>
                        <td class="col1">登记时间</td>
                        <td class="col2"><label id="registerTime"></label></td>
                    </tr>
                    <tr>
                        <td class="col1">产品编号</td>
                        <td class="col2"><label id="productId"></label></td>
                        <td class="col1">产品名称</td>
                        <td class="col2"><label id="productName"></label></td>
                    </tr>
                    <tr>
                        <td class="col1">描述</td>
                        <td class="col2"><label id="productDescribe"></label></td>
                        <td class="col1">数量</td>
                        <td class="col2"><label id="amount"></label></td>
                    </tr>
                    <tr>
                        <td class="col1">备注</td>
                        <td class="col2"><textarea id="remark"></textarea></td>
                        <td class="col1"></td>
                        <td class="col2"><label></label></td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="/js/jquery-3.7.0.min.js"></script>
<script type="text/javascript" src="/bootstrap/bootstrap-5.3.3-dist/js/bootstrap.bundle.min.js"></script>
<script type="text/javascript">
    $(function () {
        init()

        $("#preview").click(function () {
            let designer = $("#designer").val()
            let register = $("#register").val()
            let productId = $("#productId").html()
            let productName = $("#productName").html()
            let productDescribe = $("#productDescribe").html()
            let amount = $("#amount").html()
            let remark = $("#remark").val()
            if (designer == "" || register == "" || remark == "") {
                alert("请完善信息！")
                return
            }
            let data = {
                designer: designer,
                register: register,
                productId: productId,
                productName: productName,
                productDescribe: productDescribe,
                amount: amount,
                remark: remark
            }
            sessionStorage.setItem("data", JSON.stringify(data))
            window.location.href = "/m-manufacture/production_Dispatch_order_preview"
        })
    })
    function init() {
        let id = sessionStorage.getItem("ids")
        $.ajax({
            url: "/m-apply/getMApplyById?id=" + id,
            type: "get",
            dataType: "json",
            success: function (data) {
                $("#productId").html(data.productId)
                $("#productName").html(data.productName)
                $("#productDescribe").html(data.productDescribe)
                $("#amount").html(data.amount)
                $("#registerTime").html(data.registerTime)
            }
        })
    }

</script>
</body>
</html>
